<#include "/common/_layout.html"/>
<#include "/common/_search_form.html"/>
<@layout>
<h1>模块管理&nbsp;&nbsp;
<a href="${BASE_PATH!}/module/add">创建模块</a>
</h1>
<@search_form actionUrl="${BASE_PATH!}/module/page">
隶属项目：
<select name="project_id" id="project_id">
</select>
上级模块：
<select name="parent_id" id="parent_id">
</select>
模块名称：
<input type="text" name="module_name">
<script type="text/javascript">
$(document).ready(function(){
	var initSel_project_id = function(callback){
		SelectTool.initSelectData({
			elId:"project_id",
			url:"${BASE_PATH!}/project/listAll",
			postData:{},
			valueName:"id",
			textName:"project_name",
			defaultValue:"${(project_id)!}",
			haveAll:true,
			callback:callback
		});
	}
	var initSel_parent_id = function(callback){
		SelectTool.initSelectData({
			elId:"parent_id",
			url:"${BASE_PATH!}/module/listByProjectId",
			postData:{"project_id":$("#project_id").val()},
			valueName:"id",
			textName:"module_name",
			haveAll:true,
			callback:callback
		});
	}
	$("#project_id").change(function(){
		initSel_parent_id(function(){
			initSearch(1);
		});
	});
	$("#parent_id").change(function(){
		initSearch(1);
	});
	//初始化
	initSel_project_id(function(){
		initSel_parent_id(function(){
			initSearch(1);
		});
	});
});
</script>
</@search_form>
</@layout>